from primes import prime

primes = set([1])
primeGen = prime()
largestPrime = 0

nr = 1

while True:
    nr += 2
    
    while largestPrime < nr:
        largestPrime = primeGen.next()
        primes.add(largestPrime)
        
    i = 0
    while True:
        remainder = nr - 2 * i * i
        if remainder < 0: 
            print "FOUND: ", nr
            exit(10)
        if remainder in primes:
            print nr, "=", remainder, "+ 2 *", i, "^2"
            break
        i += 1
        
            

    
    
    
    